package com.atguigu.staticservice.controller;


import com.aiguigu.commonutils.R;
import com.atguigu.staticservice.service.StatisticsDailyService;
import io.swagger.annotations.Api;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import java.util.Map;

/**
 * <p>
 * 网站统计日数据 前端控制器
 * </p>
 *
 * @author Y丶HS练习谷粒商城
 * @since 2022-10-11
 */
@Api(description = "echarts APInfo")
@RestController
@RequestMapping("/statistics/statisticsDaily")
public class StatisticsDailyController {


    @Resource
    private StatisticsDailyService statisticsDailyService;

    @PostMapping("/registerCount/{day}")
    public R registerCount(@PathVariable("day") String day){
        statisticsDailyService.registerCount(day);
        return R.ok();
    }

    @GetMapping("showData/{type}/{begin}/{end}")
    public R showData(@PathVariable("type") String type, @PathVariable("begin") String begin, @PathVariable("end") String end){
        Map map =statisticsDailyService.showData(type, begin, end);
        return R.ok().data(map);
    }
}

